#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
const int n = 64;
const int _ = 1e6 + 10;
int m, s[_], x[_], y[_];
ull col[3][n], ok[_][n];
mt19937 rng(114514);
inline bool solve(void) {
    for (int i = 0; i < n; i++) {
        col[0][i] = col[1][i] = col[2][i] = 0LLU;
        for (int j = 0; j < n; j++) {
            (col[uniform_int_distribution<int>(0, 2)(rng)][i] |= (1LLU << ((ull)(j))));
        }
    }
    for (int i = 1; i <= m; i++) {
        bool tmp = false;
        int c = s[i];
        if (i == 1) {
            for (int j = 0; j < n; j++) {
                ok[i][j] = col[c][j];
                if (ok[i][j]) {
                    tmp = true;
                }
            }
        } else {
            for (int j = 0; j < n; j++) {
                ok[i][j] = ((ok[i-1][j] << 1LLU) | (ok[i-1][j] >> 1LLU));
                if (j != 0) (ok[i][j] |= ok[i-1][j-1]);
                if (j != n - 1) (ok[i][j] |= ok[i-1][j+1]);
                (ok[i][j] &= col[c][j]);
                if (ok[i][j]) {
                    tmp = true;
                }
            }
        }
        if (!tmp) return false;
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (ok[m][i] & (1LLU << ((ull)(j)))) {
                x[m] = i;
                y[m] = j;
            }
        }
    }
    for (int i = m - 1; i >= 1; i--) {
        if (x[i+1] != 0 && (ok[i][x[i+1] - 1] & (1LLU << ((ull)(y[i+1]))))) {
            x[i] = x[i+1] - 1;
            y[i] = y[i+1];
        } else if (x[i+1] != n - 1 && (ok[i][x[i+1] + 1] & (1LLU << ((ull)(y[i+1]))))) {
            x[i] = x[i+1] + 1;
            y[i] = y[i+1];
        } else if (y[i+1] != 0 && (ok[i][x[i+1]] & (1LLU << ((ull)(y[i+1] - 1))))) {
            x[i] = x[i+1];
            y[i] = y[i+1] - 1;
        } else if (y[i+1] != n - 1 && (ok[i][x[i+1]] & (1LLU << ((ull)(y[i+1] + 1))))) {
            x[i] = x[i+1];
            y[i] = y[i+1] + 1;
        }
    }
    return true;
}
int main() {
    freopen("snake.in", "r", stdin);
    freopen("snake.out", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    string str;
    cin >> str;
    m = str.length();
    for (int i = 1; i <= m; i++) {
        switch (str[i - 1]) {
            case 'R': {
                s[i] = 0;
                break;
            }
            case 'G': {
                s[i] = 1;
                break;
            }
            case 'B': {
                s[i] = 2;
                break;
            }
        }
    }
    while (!solve());
    cout << n << ' ' << n << '\n';
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (col[0][i] & (1LLU << ((ull)(j)))) {
                cout << 'R';
            } else if (col[1][i] & (1LLU << ((ull)(j)))) {
                cout << 'G';
            } else if (col[2][i] & (1LLU << ((ull)(j)))) {
                cout << 'B';
            }
        }
        cout << '\n';
    }
    cout << x[1] + 1 << ' ' << y[1] + 1 << '\n';
    for (int i = 2; i <= m; i++) {
        if (x[i] == x[i-1] - 1 && y[i] == y[i-1]) {
            cout << 'U';
        } else if (x[i] == x[i-1] + 1 && y[i] == y[i-1]) {
            cout << 'D';
        } else if (x[i] == x[i-1] && y[i] == y[i-1] - 1) {
            cout << 'L';
        } else if (x[i] == x[i-1] && y[i] == y[i-1] + 1) {
            cout << 'R';
        }
    }
    cout << endl;
    return 0;
}